package com.neusoft.neuiotms.dcam.workflow.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;

import org.hibernate.validator.constraints.Length;

import com.neusoft.bizcore.web.jpa.model.AbstractAuditModel;
import com.neusoft.bizcore.web.jpa.model.Comment;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@Entity
@Table(name = "neuiot_workorder_ruku_kj_goods_file")
@org.hibernate.annotations.Table(appliesTo = "neuiot_workorder_ruku_kj_goods_file", comment = "科技到货验收配件表")
public class RukuKJGoodsFile extends AbstractAuditModel {

    private static final long serialVersionUID = 1L;

    @ManyToOne
    private RukuKJ goods;

    /** 货品名称 */
    @NotBlank(message = "货品名称不能为空")
    @Length(max = 255, message = "货品名称不能超过{max}位")
    @Column(length = 255, nullable = false)
    @Comment("varchar(255) NOT NULL COMMENT '货品名称'")
    private String name;

    /** 货品编号 */
    @NotBlank(message = "货品编号不能为空")
    @Length(max = 255, message = "货品编号不能超过{max}位")
    @Column(length = 255, nullable = false, unique = true)
    private String code;

    /** 备品备件类型 */
    @NotBlank(message = "备品备件类型编码不能为空")
    @Length(max = 255, message = "备品备件类型编码不能超过{max}位")
    @Column(length = 255, nullable = false)
    @Comment("varchar(255) NOT NULL COMMENT '备品备件类型编码'")
    private String spareTypeCode;

    /** 备品备件类型 */
    @NotBlank(message = "备品备件类型名称不能为空")
    @Length(max = 255, message = "备品备件类型名称不能超过{max}位")
    @Column(length = 255, nullable = false)
    @Comment("varchar(255) NOT NULL COMMENT '备品备件类型名称'")
    private String spareTypeName;

    /** 规格型号 */
    @NotBlank(message = "规格型号不能为空")
    @Length(max = 255, message = "规格型号不能超过{max}位")
    @Column(length = 255, nullable = false)
    @Comment("varchar(255) NOT NULL COMMENT '规格型号'")
    private String specification;

    /** 描述 */
    @Length(max = 255, message = "描述不能超过{max}位")
    @Comment("varchar(255) NULL DEFAULT NULL COMMENT '描述'")
    private String description;

    /** 所属资产 */
    @Column(length = 255, nullable = true)
    private String assetCode;

    /** 使用部门名称 */
    @Length(max = 255, message = "使用部门不能超过{max}位")
    @Column(length = 255, nullable = true)
    private String managementOrgName;

    /** 使用部门编码 */
    @Length(max = 255, message = "使用部门编码不能超过{max}位")
    @Column(length = 255, nullable = true)
    private String managementOrgCode;

}
